load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "gc",
    srcs = [
        "gc.go",
        "gc_iterator.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/gc",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/abortspan",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/rditer",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/util",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/bufalloc",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "gc_test",
    size = "large",
    srcs = [
        "data_distribution_test.go",
        "gc_int_test.go",
        "gc_iterator_test.go",
        "gc_old_test.go",
        "gc_random_test.go",
        "gc_test.go",
        "main_test.go",
    ],
    embed = [":gc"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/rditer",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/settings/cluster",
        "//pkg/sql/sqlliveness/slbase",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
